using UnityEngine;

namespace Assets.Scripts.SO
{
    [CreateAssetMenu(fileName = "ScriptableUpgrade", menuName = "ScriptableObjects/ScriptableUpgrade", order = 1)]
    public class ScriptableUpgrade : ScriptableObject
    {
        [field: SerializeField] public string SaveKey { get; private set; }
        [field: SerializeField] public string Title { get; private set; }
        [field: SerializeField] [field: TextArea] public string Description { get; private set; }
        [field: SerializeField] public int[] UpgradePrices { get; private set; }
        [field: SerializeField] public float[] UpgradeValues { get; private set; }

        public int Level => PlayerPrefs.GetInt(SaveKey, 0);
        public float Value => UpgradeValues[Level];
    }
}
